import { getData, postData } from "@/utils/request";


/**
 * 获取答题类别
 * @param {*} url 
 * @returns 
 */
export const getQuesCategory = async () => {
    const questionCate = await getData('/serviceQuestionCategory/queryQuestionCategoryNameList');
    return questionCate;
};

/**
 * 获取党员的考题
 * @param {*} url 
 * @returns 
 */
export const getAllQuestion = async (questionCategoryId, partyId) => {
    const allQuestion = await postData('/serviceExaminationManagement/queryExaminationByPartyId', { questionCategoryId, partyId });
    return allQuestion;
};


/**
 * 查询考题详情
 * @param {*} id 
 * @returns 
 */
export const getExamDtl = async (id) => {
    const questionDtl = await getData(`/serviceExaminationManagement/queryExaminationDetail/${id}`);
    return questionDtl;
};

/**
 * 提交用户的答题信息
 * @param {*} id 
 * @returns 
 */
export const submitAnswer = async (data) => {
    const questionDtl = await postData('/serviceAnswerRecord/submitAnswerQuestion', data);
    return questionDtl;
};